#pragma once

class CDatabaseManager
{
public:
    CDatabaseManager(void);
    ~CDatabaseManager(void);

public:
    DWORD
    Open(
        const TCHAR *const DatabaseFileName,
        UINT RecordSize,
        BOOL ClearIfExists = FALSE);
    void Close();
    DWORD
    ReadRecord(
        UINT RecordIndex,
        BYTE *RecordData,
        UINT RecordDataLength,
        UINT *pRecordDataActualLength);
    DWORD
    WriteRecord(
        UINT RecordIndex,
        BYTE *RecordData,
        UINT RecordDataLength);
    DWORD GetRecordCount(UINT *pRecordCount);
    DWORD DeleteRecord(UINT RecordIndex);

private:
    HANDLE m_hDatabaseFile;
    UINT m_RecordSize;
};
